This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
I am trying to build a button that finds a document by a key and will then get an item value in that document and replace it.
I am more familiar with formula and rather weak on script. So simple is better.
What I am looking to do is post the received item count to another document that is used for inventory details. However it will not be a parent child relationship.
So hit post button and it looks for a doc matching the key value then grabs the inventory count and adds it to a temp value and then replaces it with the new value.
Then resets the values and goes to look for the second document by the next item key.
Feedback number WEBB8TJ97G created by ~Chloe Minfreeskiader on 04/20/2012
Status: Closed
Comments: FYI Working code.
Sub Click(Source As Button)
Dim session As New NotesSession
Dim ws As New notesuiworkspace
Dim uidoc As notesuidocument
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim lookupkey As String
Dim invcount As Long
Set uidoc = ws.currentdocument
lookupkey = uidoc.FieldGetText("POSKU")
Set db = session.CurrentDatabase
Set view = db.GetView("Inventory")
Set doc = view.GetDocumentByKey(lookupkey, True)
invcount = doc.Item_InStock(0)
invcount = invcount + Clng(uidoc.FieldGetText("POQTY_In"))
doc.Item_InStock = invcount
Call doc.Save(True, True)
End Sub